const axios = require('axios')
//
axios
  .get(`https://www.meituan.com/cate/184367365/`, {
    headers: {
      // Accept:
      //   'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
      // 'Accept-Encoding': 'gzip, deflate',
      // 'Accept-Language': 'zh-CN,zh;q=0.9',
      // 'Cache-Control': 'no-cache',
      // Connection: 'keep-alive',
      // Cookie:
      //   '_lxsdk_cuid=167f7f2b442c8-055a439869754f-10346654-1aeaa0-167f7f2b442c8; uuid=1f915be4690f4ddf89b9.1546503089.1.0.0; iuuid=D5A39B1340AFADB0E8F779DE306C8DDFD80CAA371389258F08DB9526AFEBFA7D; cityname=%E6%B5%8E%E5%8D%97; _lxsdk=D5A39B1340AFADB0E8F779DE306C8DDFD80CAA371389258F08DB9526AFEBFA7D; _ga=GA1.2.2078843145.1546505461; _gid=GA1.2.549164388.1546505461; _lx_utm=utm_source%3DBaidu%26utm_medium%3Dorganic; ci=96; rvct=96%2C10%2C1%2C1254',
      // Host: 'apimobile.meituan.com',
      // Pragma: 'no-cache',
      // 'Upgrade-Insecure-Requests': '1',
      'User-Agent':
        'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'
    }
  })
  .then(
    da => {
      // const ma = da.data.match(/window._appState = ({.+})?/g)
      const ma = /window.AppData = ({.+})?/g.exec(da.data)
      console.log(JSON.parse(ma[1]))
    },
    err => {
      console.log(err)
    }
  )

// // https://p0.meituan.net/hotel/c8c9eba3a930a05abf7a14613424832f243178.png@220w_125h_1e_1c

//
